<?php
session_start();
require_once('classes/facebook.php');
$facebook = new Facebook();

$facebook -> setSession($_GET['code']);
//echo "Your OAuth key is: ".$_SESSION['authKey'];
//echo "<br /><br /><br />Here are your interests:<br />";
$facebook -> get_likes("");
//foreach($_SESSION['likes'] as $l){
//	print $l."<br />";
//}
//header("location: pickFriend.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="css/suggestBox.css"/>
<link rel="stylesheet" type="text/css" href="css/jquery.auto.css"/>
<script type="text/javascript" >
var testData = {};
testData.webSites = <? echo $facebook -> get_friends(); ?>;
</script>
</head>
<body>
<br /><br />
<input type="text" size="50" id="autoFriend" />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<? //if(!empty($_SESSION['name'])){ ?>
<p><a href="likeViewer.php" target="_blank">Click here to see the interests of the friend you chose.</a></p>
<? //} ?>
<br /><br /><br /><br /><br /><br /><br /><br /><br />
</body>
<script language="JavaScript" src="js/jquery-1.3.2.min.js"></script>
<script language="JavaScript" src="js/jquery.jsonSuggest.js"></script>
<script>
function callback(item) {
	document.location = 'http://www.thehi.me/pennapps/likeViewer.php?name=' + item.name + '&id=' + item.id;
}
jQuery(function() {
	$('input#autoFriend').jsonSuggest(testData.webSites, {onSelect: callback});
});
</script>
</html>